package com.dream.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.BatchSize;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;

/**
 * 学生集团年级班表
 * 
 * @author Administrator
 *
 */
@Entity
@Table(name = "sys_class")
public class Sys_Class extends AllId implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String name;

	private String cid;

	private String cpid = "0";

	private String type;// 1集团 2学校，3年级，4表示班

	private Integer lv = 1;// 当前等级对应 1-12年级，每过一年就加一级，到下一个年级，

	private String note;

	private String timeLearn;// 作习时间表

	private String addresss;

	private String cpassword;// 班级密码 ;用户学生登陆

	private Integer open = 0;

	private String pName = "";
	
	private List<Sys_ClassPlant> cpList = null;// 这个年级有多少课表

	private List<Sys_User_Class> listsuc = null;// 一个年级，可以有多少学生，老师

	private List<Sys_LearnPlant_Class> listslpc = null;

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "sys_Class", orphanRemoval = true)
	@Cascade(value = { CascadeType.SAVE_UPDATE })
	@BatchSize(size = 20)
	public List<Sys_LearnPlant_Class> getListslpc() {
		return listslpc;
	}

	public void setListslpc(List<Sys_LearnPlant_Class> listslpc) {
		this.listslpc = listslpc;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "sys_Class", orphanRemoval = true)
	@Cascade(value = { CascadeType.SAVE_UPDATE })
	@BatchSize(size = 20)
	public List<Sys_User_Class> getListsuc() {
		return listsuc;
	}

	public void setListsuc(List<Sys_User_Class> listsuc) {
		this.listsuc = listsuc;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "sys_Class", orphanRemoval = true)
	@Cascade(value = { CascadeType.SAVE_UPDATE })
	@BatchSize(size = 20)
	public List<Sys_ClassPlant> getCpList() {
		return cpList;
	}

	public void setCpList(List<Sys_ClassPlant> cpList) {
		this.cpList = cpList;
	}

	@Column(name = "cName")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCid() {
		return cid;
	}

	public void setCid(String cid) {
		this.cid = cid;
	}

	public String getCpid() {
		return cpid;
	}

	public void setCpid(String cpid) {
		this.cpid = cpid;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public Integer getLv() {
		return lv;
	}

	public void setLv(Integer lv) {
		this.lv = lv;
	}

	@Column(length = 5000)
	public String getTimeLearn() {
		return timeLearn;
	}

	public void setTimeLearn(String timeLearn) {
		this.timeLearn = timeLearn;
	}

	public String getCpassword() {
		return cpassword;
	}

	public void setCpassword(String cpassword) {
		this.cpassword = cpassword;
	}

	public String getAddresss() {
		return addresss;
	}

	public void setAddresss(String addresss) {
		this.addresss = addresss;
	}

	public Integer getOpen() {
		return open;
	}

	public void setOpen(Integer open) {
		this.open = open;
	}

	public String getpName() {
		return pName;
	}

	public void setpName(String pName) {
		this.pName = pName;
	}

	public Sys_Class(String table_id, String name, String cid, String cpid, String type, Integer lv, String note, String timeLearn, String addresss, String cpassword, Integer open, String pName, String showCreateTime, String string1, String string2) {
		super(table_id);
		this.name = name;
		this.cid = cid;
		this.cpid = cpid;
		this.type = type;
		this.lv = lv;
		this.note = note;
		this.timeLearn = timeLearn;
		this.addresss = addresss;
		this.cpassword = cpassword;
		this.open = open;
		this.pName = pName;
		super.setString1(string1);
		super.setString2(string2);
		super.setShowTime(showCreateTime);
	}
	
	public Sys_Class(String table_id, String name, String cid, String cpid, String type, Integer lv, String note, String timeLearn, String addresss, String cpassword, Integer open, String pName, String showCreateTime) {
		super(table_id);
		this.name = name;
		this.cid = cid;
		this.cpid = cpid;
		this.type = type;
		this.lv = lv;
		this.note = note;
		this.timeLearn = timeLearn;
		this.addresss = addresss;
		this.cpassword = cpassword;
		this.open = open;
		this.pName = pName;
		super.setShowTime(showCreateTime);
	}

	public Sys_Class() {

	}
}
